<?php

/**
 * Description of ScannerForm
 *
 * @author Thomas Vo
 */
class ScannerForm extends BRFormModel
{
    public $searchField;
    
    public function attributeGroups()
    {
        return array(
            new AttributeGroup('Scanner',array(
                'searchField',
            ))
        );
    }
    
    public function rules()
    {
        return array(
            array('searchField','safe'),
        );
    }
    
    public function scan($keywords = null)
    {
        $scanner = new BRScanner($keywords ? $keywords : $this->searchField);
        return $scanner->search();
    }
}

?>
